#pragma once

#include <iostream>

#define AUTORUN_APP_NAME string("auto")

class StuService
{
public:
	explicit StuService(std::wstring wstrOptArg);
	~StuService();

	bool StartRunService();

private:
	void Init();

	bool IsInstall();

	bool InstallService();

	bool UnInstallService();

	static void WINAPI ServiceMain();
	static void WINAPI ServiceCtrl(DWORD dwOpCode);

private:
	std::wstring m_wstrServiceOpt;
	bool m_bInstall;

	static TCHAR m_szServiceName[100];
	static SERVICE_STATUS_HANDLE m_hServiceStatus;
	static SERVICE_STATUS m_stStatus;
	static DWORD m_dwPostThreadId;
};